/**参数 ulid -- liclassName -- 更改内容className  */

var tab = function(id,nav,list) {
    var oUl = document.getElementById(id);
    var oLis = oUl.getElementsByTagName('li');
    for(var i = 0; i < oLis.length; i++) {
        oLis[i].index = i;
        oLis[i].onclick = function() {
            for(var j = 0; j < oLis.length; j++) {
                oLis[j].className = '';
            }
            this.className = nav;
            var boxs = document.getElementsByClassName(list);
            var box = boxs[this.index];
            for(var j = 0; j < boxs.length; j++) {
                boxs[j].style.display = 'none';
            }
            box.style.display = 'block';
        }
    }
}

